using BuildingBlocks.Core.Entities;
using User.Domain.ValueObjects;

namespace User.Domain.Entities;
public class UserProfile : AggregateRoot<Guid>
{
    public new Guid Id { get; set; }
    public string NickName { get; set; } = default!;
    public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
    public DateTime? LastLoginTime { get; set; }
    public string? AvatarUrl { get; set; }
    public PhoneNumber? PhoneNumber { get; set; }
    public string? Address { get; set; }
    private UserProfile() { }
    public static UserProfile Register(Guid userId, string nickName, PhoneNumber? phoneNumber = null, string? address = null)
    {
        return new UserProfile
        {
            Id = userId,
            NickName = nickName,
            PhoneNumber = phoneNumber,
            Address = address,
            CreatedAt = DateTime.UtcNow,

        };
    }
}